#pragma once

#include <cstdlib>
#include "common/config.h"

struct PathPoint {
    PathPoint(float s1, float l1, float theta1) : s(s1), l(l1), theta(theta1) {}
    float s = 0;
    float l = 0;
    float theta = 0;
};

struct __attribute__((aligned(kAligned))) CubicPolynomialCoeffs {  // GPU上要使用的结构体
    float start_s;
    float end_s;
    float a3;
    float a2;
    float a1;
    float a0;
};

struct __attribute__((aligned(kAligned))) PathInfo {  // GPU上要使用的结构体
    int path_index = 0;
    float min_s;
    float max_s;
    int cubic_polynomial_coeff_nums;
    int cubic_polynomial_coeff_offset;
    int point_info_nums;
    int point_info_offset;
};

struct __attribute__((aligned(kAligned))) RefPoint {  // GPU上要使用的结构体
    float s;
    float x;
    float y;
    float theta;
};

struct __attribute__((aligned(kAligned))) PointInfo {  // GPU上要使用的结构体
    int path_index = 0;
    int point_index = 0;
    float s = 0;
    float l = 0;
    float theta_ref = 0;
    float x = 0;
    float y = 0;
};

struct __attribute__((aligned(kAligned))) DataInfo{  // GPU上要使用的结构体
    float max_length;
    int path_nums;

    float min_ref_s = 0;
    float max_ref_s = 0;

    int refline_offset;
    int path_info_offset;
    int path_coeffs_offset;
    int point_info_offset;
};
